package orchome.com;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.Map;

/**
 * Created by caicai on 2016/6/15.
 */
@Controller
public class SampleController {

    @Value("${application.message:Hello World}")
    String message="hello spring boot";
    @RequestMapping("/")
    @ResponseBody
    String hello(){
        return "Hello World!";
    }

    @RequestMapping("/user")
    String userInfo(Map<String,Object> model){
        model.put("time",new Date());
        model.put("message", message);
        return "user_add";
    }
}